package com.zxf.basic.utils

/**
 * @author yuansui
 * @since 2018/8/6
 */

/**
 * 普通的RxBus
 */
class Bus private constructor() : RxBus() {

    companion object {
        private var bus: Bus? = null
            get() {
                if (field == null) {
                    field = Bus()
                }
                return field
            }

        @JvmStatic
        fun get(): Bus {
            return bus ?: Bus()
        }

        @JvmStatic
        fun close() {
            bus?.release()
            bus = null
        }
    }
}
